#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'

void solve() {
	ll p, a, b, c; cin >> p >> a >> b >> c;
	if (b == 0) {
		if (c != 0) {
			cout << "No" << endl;
			return;
		}
		else {
			cout << "Yes" << endl;
			return;
		}
	}
	cout << "Yes" << endl;
}


int main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int t; cin >> t;
	while (t--) {
		solve();
	}
	return 0;
}